package nuist.hanniko.stu.webbackend.interceptor;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@Component
public class PermissionHandlerInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        Map<String, String[]> map = request.getParameterMap();
        for (Map.Entry entry : map.entrySet()) {
            System.out.println(entry.getKey() + ((String[]) entry.getValue())[0]);
        }
        return true;
    }
}
